import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    token: localStorage.getItem("token")
  },
  mutations: {
    saveToken(state, token) {
      state.token = token;
      localStorage.setItem("token", state.token);
    },
    removeToken(state) {
      state.token = null;
      localStorage.removeItem("token");
    }
  },
  // getters: {

  // },
  actions: {},
  modules: {}
});
